#include <vector>
#include <iostream>
#include <algorithm>
#include <windows.h>

using namespace std;

class Human
{
public: 
    //构造函数   
    Human(char sex = '0', int age = 0, double high = 0, double weight = 0.00){
        m_age = age;
        m_high = high;
        m_weight = weight;
        m_sex = sex;      
    }        
    ~Human(){
        cout << "die" << endl;
    };       //析构函数

    bool run(char direct, int v){
        cout << "direct=" << direct << "v=" << v << endl;
        return true;
    }

    void setsex(char sex){m_sex = sex;}
    void setage(int age){m_age = age;}
    void sethigh(double high){m_high = high;}
    void setweight(double weight){m_weight = weight;}

    char getsex(){return m_sex;}
    int  getage(){return m_age;}
    double gethigh(){return m_high;}
    double getweight(){return m_weight;}
private:
    char   m_sex;        //0 表示女性  1 表示男性  
    int    m_age;
    double m_high;           //cm
    double m_weight;          //kg
};

void test(){
    Human lll('1');

    Human lilei('1', 0, 61, 6.5);
    
    cout << "sex="<< lilei.getsex() << " age="<< lilei.getage() << " high=" << lilei.gethigh() << " weight=" << lilei.getweight() << endl;

    for(int i = 0; i < 100; i++)
    {
        Sleep(1000);

        lilei.setage(lilei.getage() + 1);   

        if(lilei.getage() < 18)
        {
            lilei.sethigh(lilei.gethigh() + 1);
            lilei.setweight(lilei.getweight() + 1);
        }

        lilei.setweight(lilei.getweight() + 0.1);

        if(lilei.getage() > 70)
        {
            lilei.sethigh(lilei.gethigh() - 0.3);
            lilei.setweight(lilei.getweight() + 0.2);
        }

        cout << "sex="<< lilei.getsex() << " age="<< lilei.getage() << " high=" << lilei.gethigh() << " weight=" << lilei.getweight() << endl;
    }
}

int main(int argc, char const *argv[])
{
    cout << "game begin" << endl;

    test();

    cout << "game over" << endl;

    return 0;
}
